/*
 * @Author       : xh
 * @Date         : 2022-10-11 17:48:41
 * @LastEditors: y001554
 * @FileName     :
 */
// import { vuePlugin } from "vitepress-demo-editor";
// import "vitepress-demo-editor/dist/style.css";
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import Theme from 'vitepress/dist/client/theme-default'

import mini from '../../../packages/plugins/index'
import { MpDialog } from '../../../packages/plugins/index'
// 插件的组件，主要是demo组件
import 'vitepress-theme-demoblock/theme/styles/index.css'
import './reset.css'
// 插件的组件，主要是demo组件
import { registerComponents } from './register-components.js'
export default {
  ...Theme,
  enhanceApp({ app }) {
    // app.component('mButton', Button),
    // app.use(Button)

    app.use(ElementPlus)
    // app.config.globalProperties.$MpDialog = MpDialog

    // 新增
    //  app.use(vuePlugin, {
    //   defaultDirection: "column", // 默认显示方向
    //   ms: 30, // 编辑器防抖时间
    //   handleError(errs) {}, // 错误信息
    //   onMonacoCreated(monaco) {}, // monaco 创建成功时触发
    // });
    // 注册demoblock插件需要用到的两个组件
    registerComponents(app)
    app.mixin({
      async mounted() {
        app.use(mini)
        window.MpDialog = MpDialog
      }
    })
  }
}
